import torch
import torchvision
from torch import tensor, nn
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter

input = tensor([[1,-0.5],
                [-1,3]])

input = torch.reshape(input,(-1,1,2,2))

class MyNN(nn.Module):
    def __init__(self):
        super(MyNN, self).__init__()
        self.relu_1 = nn.ReLU()
        self.sigmoid_1 = nn.Sigmoid()

    def forward(self,input):
        output = self.sigmoid_1(input)
        return output

my_nn = MyNN()
print(input)
output = my_nn(input)
print(output)

dataset = torchvision.datasets.CIFAR10("./dataset_2",train=False,transform=torchvision.transforms.ToTensor(),download=True)
data_loader = DataLoader(dataset=dataset,batch_size=64)
writer = SummaryWriter("logs_sigmoid")

step=0
for data in data_loader:
    imgs,lables = data
    writer.add_images("input",imgs,step)
    output = my_nn(imgs)
    writer.add_images("output",output,step)
    step=step+1

writer.close()